home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / vbjigsaw.zip / JIGSAW.BAS < prev    next >
BASIC Source File  |  1991-05-07  |  1KB  |  37 lines

  1. DefInt A-Z
  2.  
  3. Declare Function GetSystemMenu Lib "User" (ByVal Hwnd, ByVal bRevert)
  4. Declare Function RemoveMenu Lib "User" (ByVal hMenu, ByVal nPosition, ByVal wFlags)
  5.  
  6. Const MF_BYPOSITION = &H400
  7.  
  8.  
  9. ' Modal dialog boxes usually do not have a System menu or if
  10. ' they do, they consist of only MOVE and CLOSE options.  This
  11. ' routine is called when a Modal dialog box is about to be
  12. ' displayed, to remove all but the MOVE and CLOSE options
  13. ' from the forms system menu.  IconWorks has only two Modal
  14. ' dialog boxes: About and SaveFileDlg
  15. '
  16. Sub Remove_Items_From_Sysmenu (A_Form As Form)
  17.  
  18.     ' Obtain the handle to the forms System menu
  19.     '
  20.     HSysMenu = GetSystemMenu(A_Form.Hwnd, 0)
  21.   
  22.     ' Remove all but the MOVE and CLOSE options.  The menu items
  23.     ' must be removed starting with the last menu item to prevent
  24.     ' the menu items from taking on new position values as other
  25.     ' menu items are being removed.
  26.     '
  27.     R = RemoveMenu(HSysMenu, 8, MF_BYPOSITION) 'Switch to
  28.     R = RemoveMenu(HSysMenu, 7, MF_BYPOSITION) 'Separator
  29.     R = RemoveMenu(HSysMenu, 5, MF_BYPOSITION) 'Separator
  30.     R = RemoveMenu(HSysMenu, 4, MF_BYPOSITION) 'Maximize
  31.     R = RemoveMenu(HSysMenu, 3, MF_BYPOSITION) 'Minimize
  32.     R = RemoveMenu(HSysMenu, 2, MF_BYPOSITION) 'Size
  33.     R = RemoveMenu(HSysMenu, 0, MF_BYPOSITION) 'Restore
  34.  
  35. End Sub
  36.  
  37.